home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / wschesb1.zip / SRC / DSP.C < prev    next >
C/C++ Source or Header  |  1994-03-16  |  17KB  |  619 lines

  1. /*
  2.   C source for Winsock Chess
  3.   
  4.   Revision 1994-03-15
  5.   Modified by Donald Munro for use as a 2 player chess game over a 
  6.   WINSOCK layer on a TCP (or other WinSock supporting) network.
  7.   Source code and make files for MS Visual C/C++ V1.00/1.50.
  8.   February/March 1994
  9.   All GNU copyright and distribution conditions as described below and in the
  10.   file COPYING also apply to WinSock Chess.
  11.   This module is adapted from GNU Chess.
  12.  
  13.   C source for GNU CHESS
  14.  
  15.   Revision: 1990-09-30
  16.  
  17.   Modified by Daryl Baker for use in MS WINDOWS environment
  18.  
  19.   Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc.
  20.   Copyright (c) 1988, 1989, 1990  John Stanback
  21.  
  22.   This file is part of CHESS.
  23.  
  24.   CHESS is distributed in the hope that it will be useful, but WITHOUT ANY
  25.   WARRANTY.  No author or distributor accepts responsibility to anyone for
  26.   the consequences of using it or for whether it serves any particular
  27.   purpose or works at all, unless he says so in writing.  Refer to the CHESS
  28.   General Public License for full details.
  29.  
  30.   Everyone is granted permission to copy, modify and redistribute CHESS, but
  31.   only under the conditions described in the CHESS General Public License.
  32.   A copy of this license is supposed to have been given to you along with
  33.   CHESS so you can know your rights and responsibilities.  It should be in a
  34.   file named COPYING.  Among other things, the copyright notice and this
  35.   notice must be preserved on all copies.
  36. */
  37.  
  38. #define NOATOM 
  39. #define NOCLIPBOARD
  40. #define NOCREATESTRUCT
  41. #define NOFONT
  42. #define NOREGION
  43. #define NOSOUND
  44. #define NOWH
  45. #define NOWINOFFSETS
  46. #define NOCOMM
  47. #define NOKANJI
  48.  
  49. #define STRICT
  50. #include <windows.h>
  51. #include <windowsx.h>
  52. #include <commdlg.h>
  53. #include <stdio.h>
  54. #include <string.h>
  55. #include <time.h>
  56. #include <direct.h>
  57.  
  58. #include "gnuchess.h"
  59. #include "defs.h"
  60. #include "chess.h"                              
  61.  
  62. extern HWND hwndMain;               
  63. extern int User_Move;    
  64.  
  65. static short _based(_segname("_CODE")) Stboard[64] =
  66. {rook, knight, bishop, queen, king, bishop, knight, rook,
  67.  pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn,
  68.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  69.  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  70.  pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn,
  71.  rook, knight, bishop, queen, king, bishop, knight, rook};
  72.  
  73. static short _based(_segname("_CODE")) Stcolor[64] =
  74. {white, white, white, white, white, white, white, white,
  75.  white, white, white, white, white, white, white, white,
  76.  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  77.  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  78.  black, black, black, black, black, black, black, black,
  79.  black, black, black, black, black, black, black, black};
  80.  
  81. int mycntl1, mycntl2;
  82.  
  83. char mvstr[4][6];
  84. long evrate;
  85. int PositionFlag = 0;
  86.  
  87. #define pxx " PNBRQK"
  88. #define qxx " pnbrqk"
  89.  
  90. void TerminateSearch (int), Die (int);
  91.  
  92. void
  93. Initialize (void)
  94. {
  95.   mycntl1 = mycntl2 = 0;
  96. }
  97.  
  98. void
  99. ExitChess (void)
  100. {
  101.  
  102. }
  103.  
  104. void
  105. Die (int Sig)
  106. {
  107. }
  108.  
  109. void
  110. TerminateSearch (int Sig)
  111. {
  112.   flag.timeout = true;
  113.   flag.bothsides = false;
  114. }
  115.  
  116. void
  117. algbr (short int f, short int t, short int flag)
  118.  
  119. /*
  120.    Generate move strings in different formats.
  121. */
  122.  
  123. {
  124.   int m3p;
  125.  
  126.   if (f != t)
  127.     {
  128.       /* algebraic notation */
  129.       mvstr[0][0] = (char) ('a'+column (f));
  130.       mvstr[0][1] = (char) ('1'+row (f));
  131.       mvstr[0][2] = (char) ('a'+column (t));
  132.       mvstr[0][3] = (char) ('1'+row (t));
  133.       mvstr[0][4] = mvstr[3][0] = '\0';
  134.       if ((mvstr[1][0] = pxx[board[f]]) == 'P')
  135.         {
  136.           if (mvstr[0][0] == mvstr[0][2])       /* pawn did not eat */
  137.             {
  138.               mvstr[2][0] = mvstr[1][0] = mvstr[0][2];  /* to column */
  139.               mvstr[2][1] = mvstr[1][1] = mvstr[0][3];  /* to row */
  140.               m3p = 2;
  141.             }
  142.           else
  143.             /* pawn ate */
  144.             {
  145.               mvstr[2][0] = mvstr[1][0] = mvstr[0][0];  /* from column */
  146.               mvstr[2][1] = mvstr[1][1] = mvstr[0][2];  /* to column */
  147.               mvstr[2][2] = mvstr[0][3];
  148.               m3p = 3;          /* to row */
  149.             }
  150.           mvstr[2][m3p] = mvstr[1][2] = '\0';
  151.           if (flag & promote)
  152.             {
  153.               mvstr[0][4] = mvstr[1][2] = mvstr[2][m3p] = qxx[flag & pmask];
  154.               mvstr[1][3] = mvstr[2][m3p + 1] = mvstr[0][5] = '\0';
  155.             }
  156.         }
  157.       else
  158.         /* not a pawn */
  159.         {
  160.           mvstr[2][0] = mvstr[1][0];
  161.           mvstr[2][1] = mvstr[0][1];
  162.           mvstr[2][2] = mvstr[1][1] = mvstr[0][2];      /* to column */
  163.           mvstr[2][3] = mvstr[1][2] = mvstr[0][3];      /* to row */
  164.           mvstr[2][4] = mvstr[1][3] = '\0';
  165.           strcpy (mvstr[3], mvstr[2]);
  166.           mvstr[3][1] = mvstr[0][0];
  167.           if (flag & cstlmask)
  168.             {
  169.               if (t > f)
  170.                 {
  171.                   strcpy (mvstr[1], "o-o");
  172.                   strcpy (mvstr[2], "O-O");
  173.                 }
  174.               else
  175.                 {
  176.                   strcpy (mvstr[1], "o-o-o");
  177.                   strcpy (mvstr[2], "O-O-O");
  178.                 }
  179.             }
  180.         }
  181.     }
  182.   else
  183.     mvstr[0][0] = mvstr[1][0] = mvstr[2][0] = mvstr[3][0] = '\0';
  184. }
  185.  
  186. int
  187. VerifyMove (HWND hWnd, char *s, short int iop, short unsigned int *mv)
  188.  
  189. /*
  190.    Compare the string 's' to the list of legal moves available for the
  191.    opponent. If a match is found, make the move on the board.
  192. */
  193.  
  194. {
  195.   static short pnt, tempb, tempc, tempsf, tempst, cnt;
  196.   static struct leaf xnode;
  197.   struct leaf  far *node;
  198.  
  199.   *mv = 0;
  200.   if (iop == 2)
  201.     {
  202.       UnmakeMove (opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
  203.       return (false);
  204.     }
  205.   cnt = 0;
  206.   MoveList (opponent, 2);
  207.   pnt = TrPnt[2];
  208.   while (pnt < TrPnt[3])
  209.     {
  210.       node = &Tree[pnt++];
  211.       algbr (node->f, node->t, (short) node->flags);
  212.       if (strcmp (s, mvstr[0]) == 0 || strcmp (s, mvstr[1]) == 0 ||
  213.           strcmp (s, mvstr[2]) == 0 || strcmp (s, mvstr[3]) == 0)
  214.         {
  215.           cnt++;
  216.           xnode = *node;
  217.         }
  218.     }
  219.   if (cnt == 1)
  220.     {
  221.       MakeMove (opponent, &xnode, &tempb, &tempc, &tempsf, &tempst, &INCscore);
  222.       if (SqAtakd (PieceList[opponent][0], computer))
  223.         {
  224.           UnmakeMove (opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
  225.           SMessageBox (hWnd, IDS_ILLEGALMOVE, IDS_CHESS);
  226.           return (false);
  227.         }
  228.       else
  229.         {
  230.           if (iop == 1)
  231.             return (true);
  232.           UpdateDisplay (hWnd, xnode.f, xnode.t, 0, (short) xnode.flags);
  233.           if ((board[xnode.t] == pawn)
  234.               || (xnode.flags & capture)
  235.               || (xnode.flags & cstlmask))
  236.             {
  237.               Game50 = GameCnt;
  238.               ZeroRPT ();
  239.             }
  240.           GameList[GameCnt].depth = GameList[GameCnt].score = 0;
  241.           GameList[GameCnt].nodes = 0;
  242.           ElapsedTime (1);
  243.           GameList[GameCnt].time = (short) et;
  244.           TimeControl.clock[opponent] -= et;
  245.           --TimeControl.moves[opponent];
  246.           *mv = (xnode.f << 8) | xnode.t;
  247.           algbr (xnode.f, xnode.t, false);
  248.           return (true);
  249.         }
  250.     }
  251.   if (cnt > 1) SMessageBox (hWnd, IDS_AMBIGUOUSMOVE, IDS_CHESS);
  252.   return (false);
  253. }
  254.  
  255. void
  256. ElapsedTime (short int iop)
  257.  
  258. /*
  259.   Determine the time that has passed since the search was started. If
  260.   the elapsed time exceeds the target (ResponseTime+ExtraTime) then set
  261.   timeout to true which will terminate the search.
  262. */
  263.  
  264. {
  265.   et = time ((long *) 0) - time0;
  266.   if (et < 0)
  267.     et = 0;
  268.   ETnodes += 50;
  269.   if (et > et0 || iop == 1)
  270.     {
  271.       if (et > ResponseTime + ExtraTime && Sdepth > 1)
  272.         flag.timeout = true;
  273.       et0 = et;
  274.       if (iop == 1)
  275.         {
  276.           time0 = time ((long *) 0);
  277.           et0 = 0;
  278.         }
  279.       if (et > 0)
  280.         /* evrate used to be Nodes / cputime I dont` know why */
  281.         evrate = NodeCnt / (et + ft);
  282.       else
  283.         evrate = 0;
  284.       ETnodes = NodeCnt + 50;
  285.     }
  286. }
  287.  
  288. void
  289. SetTimeControl (void)
  290. {
  291.   if (TCflag)
  292.     {
  293.       TimeControl.moves[white] = TimeControl.moves[black] = TCmoves;
  294.       TimeControl.clock[white] = TimeControl.clock[black] = 60 * (long) TCminutes;
  295.     }
  296.   else
  297.     {
  298.       TimeControl.moves[white] = TimeControl.moves[black] = 0;
  299.       TimeControl.clock[white] = TimeControl.clock[black] = 0;
  300.       Level = 60 * (long) TCminutes;
  301.     }
  302.   et = 0;
  303.   ElapsedTime (1);
  304. }
  305.  
  306. void GetGame (HWND hWnd, char *fname)
  307. //-----------------------------------
  308. {
  309.   FILE *fd;
  310.   int c;
  311.   short sq;
  312.   unsigned short m;
  313.  
  314.   struct GameRec tmp_rec;
  315.   char szFile[255];
  316.   
  317.   lstrcpy(szFile,fname);
  318.   AnsiToOem(szFile,szFile);
  319.  
  320.   if ((fd = fopen (fname, "r")) == NULL)
  321.     {
  322.       SMessageBox (hWnd, IDS_LOADFAILED, IDS_CHESS);
  323.       return;
  324.     }
  325.  
  326.   fscanf (fd, "%hd%hd%hd", &computer, &opponent, &Game50);
  327.   fscanf (fd, "%hd%hd", &castld[white], &castld[black]);
  328.   fscanf (fd, "%hd%hd", &TCflag, &OperatorTime);
  329.   fscanf (fd, "%ld%ld%hd%hd",
  330.           &TimeControl.clock[white], &TimeControl.clock[black],
  331.           &TimeControl.moves[white], &TimeControl.moves[black]);
  332.   for (sq = 0; sq < 64; sq++)
  333.     {
  334.       fscanf (fd, "%hd%hd", &m, &Mvboard[sq]);
  335.       board[sq] = (m >> 8);
  336.       color[sq] = (m & 0xFF);
  337.       if (color[sq] == 0)
  338.         color[sq] = neutral;
  339.       else
  340.         --color[sq];
  341.     }
  342.   GameCnt = 0;
  343.   c = '?';
  344.   while (c != EOF)
  345.     {
  346.       ++GameCnt;
  347.       c = fscanf (fd, "%hd%hd%hd%ld%hd%hd%hd", &tmp_rec.gmove,
  348.                   &tmp_rec.score, &tmp_rec.depth,
  349.                   &tmp_rec.nodes, &tmp_rec.time,
  350.                   &tmp_rec.piece, &tmp_rec.color);
  351.       GameList[GameCnt] = tmp_rec;
  352.       if (GameList[GameCnt].color == 0)
  353.         GameList[GameCnt].color = neutral;
  354.       else
  355.         --GameList[GameCnt].color;
  356.     }
  357.  
  358.   GameCnt--;
  359.   if (TimeControl.clock[white] > 0)
  360.     TCflag = true;
  361.   computer--;
  362.   opponent--;
  363.  
  364.   fclose (fd);
  365.   InitializeStats();
  366.   Sdepth = 0;
  367.   UpdateDisplay (hWnd, 0, 0, 1, 0);
  368. }
  369.  
  370. void DecodeGame (HWND hWnd,LPSTR lpszGetBuffer)
  371. //-----------------------------------
  372. { char szBuffer[4096];
  373.   FILE *fd;
  374.   char szFileName[128];
  375.   
  376.   lstrcpy(szBuffer,lpszGetBuffer);
  377.   tmpnam(szFileName);
  378.   if ((fd = fopen (szFileName, "w")) == NULL)
  379.    { SMessageBox (hWnd, IDS_LOADFAILED, IDS_CHESS);
  380.      return;
  381.    }
  382.   fprintf(fd,"%s",szBuffer);
  383.   fclose(fd);
  384.   GetGame(hwndMain,szFileName);
  385.   remove(szFileName);
  386. }
  387.  
  388. LPSTR AppendLine(char *szLine,LPSTR lpszBuffer,DWORD *cbBytes)
  389. //------------------------------------------------------------
  390. { *cbBytes += (strlen(szLine)+1);
  391. /*lpszBuffer = (LPSTR)GlobalReAllocPtr(lpszBuffer,*cbBytes,
  392.                                        GMEM_MOVEABLE | GMEM_ZEROINIT); */
  393.   lstrcat(lpszBuffer,szLine);
  394.   return lpszBuffer;
  395. }  
  396.  
  397. LPSTR EncodeGame (void)
  398. //---------------------
  399. { LPSTR lpszBuffer;
  400.   char szLine[512];
  401.   DWORD cbBytes;
  402.   short sq, i, c, opp,comp;
  403.  
  404. /*  if (opponent == white)
  405.     opp = black;
  406.   else
  407.     opp = white;   
  408.   if (computer == white)
  409.     comp = black;
  410.   else
  411.     comp = white;     */
  412.   comp = computer;
  413.   opp  = opponent;  
  414.   wsprintf (szLine,"%d %d %d\n\r", comp + 1, opp + 1, Game50);
  415.   cbBytes = strlen(szLine)+1;
  416.   lpszBuffer = (LPSTR)GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,
  417.                                      4096);
  418.   lstrcpy(lpszBuffer,szLine);
  419.   
  420.   wsprintf (szLine, "%d %d\n\r", castld[white], castld[black]);
  421.   lpszBuffer = AppendLine(szLine,lpszBuffer,&cbBytes);
  422.   
  423.   wsprintf (szLine, "%d %d\n\r", TCflag, OperatorTime);
  424.   lpszBuffer = AppendLine(szLine,lpszBuffer,&cbBytes);  
  425.   
  426.   wsprintf (szLine, "%ld %ld %d %d\n\r",
  427.            TimeControl.clock[white], TimeControl.clock[black],
  428.            TimeControl.moves[white], TimeControl.moves[black]);
  429.   lpszBuffer = AppendLine(szLine,lpszBuffer,&cbBytes);     
  430.            
  431.   for (sq = 0; sq < 64; sq++)
  432.     {
  433.       if (color[sq] == neutral)
  434.         c = 0;
  435.       else
  436.         c = color[sq] + 1;
  437.       wsprintf (szLine, "%d %d\n\r", 256 * board[sq] + c, Mvboard[sq]);
  438.       lpszBuffer = AppendLine(szLine,lpszBuffer,&cbBytes);     
  439.     }
  440.   for (i = 1; i <= GameCnt; i++)
  441.     {
  442.       if (GameList[i].color == neutral)
  443.         c = 0;
  444.       else
  445.         c = GameList[i].color + 1;
  446.       wsprintf(szLine, "%d %d %d %ld %d %d %d\n\r",
  447.                GameList[i].gmove, GameList[i].score, GameList[i].depth,
  448.                GameList[i].nodes, GameList[i].time,
  449.                GameList[i].piece, c);
  450.       lpszBuffer = AppendLine(szLine,lpszBuffer,&cbBytes);              
  451.     }
  452.   return lpszBuffer;  
  453. }
  454.  
  455.  
  456. void SaveGame (HWND hWnd, LPSTR fname)
  457. //------------------------------------
  458. {
  459.   FILE *fd;
  460.   short sq, i, c;
  461.   char szFile[255];
  462.   
  463.   lstrcpy(szFile,fname);
  464.   AnsiToOem(szFile,szFile);
  465.   if (NULL == (fd = fopen(szFile, "w")))
  466.     {
  467.       ShowMessage (hWnd, "Not saved");
  468.       return;
  469.     }
  470.  
  471.   fprintf (fd, "%d %d %d\n", computer + 1, opponent + 1, Game50);
  472.   fprintf (fd, "%d %d\n", castld[white], castld[black]);
  473.   fprintf (fd, "%d %d\n", TCflag, OperatorTime);
  474.   fprintf (fd, "%ld %ld %d %d\n",
  475.            TimeControl.clock[white], TimeControl.clock[black],
  476.            TimeControl.moves[white], TimeControl.moves[black]);
  477.   for (sq = 0; sq < 64; sq++)
  478.     {
  479.       if (color[sq] == neutral)
  480.         c = 0;
  481.       else
  482.         c = color[sq] + 1;
  483.       fprintf (fd, "%d %d\n", 256 * board[sq] + c, Mvboard[sq]);
  484.     }
  485.   for (i = 1; i <= GameCnt; i++)
  486.     {
  487.       if (GameList[i].color == neutral)
  488.         c = 0;
  489.       else
  490.         c = GameList[i].color + 1;
  491.       fprintf (fd, "%d %d %d %ld %d %d %d\n",
  492.                GameList[i].gmove, GameList[i].score, GameList[i].depth,
  493.                GameList[i].nodes, GameList[i].time,
  494.                GameList[i].piece, c);
  495.     }
  496.   fclose (fd);
  497. }
  498.  
  499.  
  500. BOOL GetFileName(LPSTR lpszFile, DWORD dwFlags, int nOp)
  501. //------------------------------------------------------
  502. { char szPwd[256],szFileTitle[128],
  503.        szFilter[128]="Chess Files (*.CHS)\0*.CHS\0All Files (*.*)\0*.*\0",
  504.        szListTitle[50]="List to File";
  505.   OPENFILENAME ofn;
  506.   
  507.   _getcwd(szPwd,255);
  508.   memset(&ofn,0,sizeof(OPENFILENAME));
  509.   *lpszFile = 0;
  510.   *szFileTitle = 0;
  511.   
  512.   ofn.lStructSize = sizeof(OPENFILENAME);
  513.   ofn.hwndOwner = hwndMain;
  514.   ofn.lpstrFilter = szFilter;
  515.   ofn.lpstrCustomFilter = NULL;
  516.   ofn.nMaxCustFilter = 0;
  517.   ofn.nFilterIndex = 1;
  518.   ofn.lpstrFile = lpszFile;
  519.   ofn.nMaxFile = 128;
  520.   ofn.lpstrFileTitle = szFileTitle;
  521.   ofn.nMaxFileTitle = 128;
  522.   ofn.lpstrInitialDir = szPwd;
  523.   ofn.lpstrTitle = NULL;
  524.   ofn.lpstrDefExt = "CHS";
  525.   ofn.Flags = dwFlags | OFN_HIDEREADONLY;
  526.   switch (nOp)
  527.     { case MSG_CHESS_SAVE :
  528.         return GetSaveFileName(&ofn);
  529.       case MSG_CHESS_GET :
  530.         return GetOpenFileName(&ofn);  
  531.       case MSG_CHESS_LIST :
  532.         lstrcpy(szFilter,
  533.                "Chess List Files (*.LST)\0*.LST\0All Files (*.*)\0*.*\0");
  534.         ofn.lpstrDefExt = "LST";       
  535.         ofn.lpstrTitle = szListTitle;
  536.         return GetSaveFileName(&ofn);
  537.     }
  538.   return FALSE;      
  539. }  
  540.  
  541. void ListGame (HWND hWnd, char *fname)
  542. //------------------------------------
  543. {
  544.   FILE *fd;
  545.   short i, f, t;
  546.  
  547.   if ( (fd = fopen (fname, "w")) == NULL) {
  548.       ShowMessage (hWnd, "Cannot write chess.lst");
  549.       return;
  550.   }
  551.  
  552.   fprintf (fd, "\n");
  553.   fprintf (fd, "       score  depth   nodes  time         ");
  554.   fprintf (fd, "       score  depth   nodes  time\n");
  555.   for (i = 1; i <= GameCnt; i++)
  556.     {
  557.       f = GameList[i].gmove >> 8;
  558.       t = (GameList[i].gmove & 0xFF);
  559.       algbr (f, t, false);
  560.       fprintf (fd, "%5s  %5d     %2d %7ld %5d", mvstr[0],
  561.                GameList[i].score, GameList[i].depth,
  562.                GameList[i].nodes, GameList[i].time);
  563.  
  564.       if ((i % 2) == 0)
  565.         fprintf (fd, "\n");
  566.       else
  567.         fprintf (fd, "         ");
  568.  
  569.     }
  570.   fprintf (fd, "\n\n");
  571.   fclose (fd);
  572. }
  573.  
  574. void
  575. Undo (HWND hWnd)
  576.  
  577. /*
  578.   Undo the most recent half-move.
  579. */
  580.  
  581. {
  582.   short f, t;
  583.   f = GameList[GameCnt].gmove >> 8;
  584.   t = GameList[GameCnt].gmove & 0xFF;
  585.   if (board[t] == king && distance (t, f) > 1)
  586.     (void) castle (GameList[GameCnt].color, f, t, 2);
  587.   else
  588.     {
  589.       /* Check for promotion: */
  590.       if ((color[t] == white && row (f) == 6 && row (t) == 7)
  591.           || (color[t] == black && row (f) == 1 && row (t) == 0))
  592.         {
  593.           int g, from = f;
  594.           for (g = GameCnt - 1; g > 0; g--)
  595.             if (GameList[g].gmove & 0xFF == from)
  596.               from = GameList[g].gmove >> 8;
  597.           if ((color[t] == white && row (from) == 1)
  598.               || (color[t] == black && row (from) == 6))
  599.             board[t] = pawn;
  600.         }
  601.       board[f] = board[t];
  602.       color[f] = color[t];
  603.       board[t] = GameList[GameCnt].piece;
  604.       color[t] = GameList[GameCnt].color;
  605.       if (color[t] != neutral)
  606.         Mvboard[t]--;
  607.       Mvboard[f]--;
  608.     }
  609.   if (TCflag)
  610.     ++TimeControl.moves[color[f]];
  611.   GameCnt--;
  612.   computer = otherside[computer];
  613.   opponent = otherside[opponent];
  614.   flag.mate = false;
  615.   Sdepth = 0;
  616.   UpdateDisplay (hWnd, 0, 0, 1, 0);
  617. }
  618.  
  619.